package demo01;

public class Main {
    public static void main(String[] args) {
        Composite root=new Composite("root");
        root.Add(new leaf("leaf A"));
        root.Add(new leaf("leaf B"));
        Composite comp=new Composite("composite X");
        comp.Add(new leaf("leaf XYA"));
        comp.Add(new leaf("leaf XYb"));
        comp.Add(new leaf("leaf XYC"));

        root.Display(1);

    }
}
